import request from "@/utils/request.js";


//添加咨询(付费)
export function saveConsult(data) {
    return request.post('wx/order/add/graphic', data);
}

//添加咨询(免费义诊)
export function saveConsultFree(data) {
    return request.post('wx/order/free', data);
}

//.获取图文问诊订单信息
export function consultOrderInfo(orderId) {
    return request.get('wx/order/detail/' + orderId);
}

//微信支付-预支付
export function wechatOrderPay(data) {
    return request.post('foregin/order/order/info', data);
}
//农行支付-预支付
export function nonghangOrderPay(data) {
    return request.post('foregin/order/order/infoAbcBank', data);
}


//医保支付-预支付
export function yibaoOrderPay(data) {
    return request.post('foregin/order/medicalOrder/info', data);
}

//医保支付-预支付查询  v2.0 
export function yibaoOrderPay2(data) {
    return request.post('wx/small/getOrderById', data);
}

//支付回调(仅测试调用，正式环境走异步回调)
export function paySuccess(orderId) {
    return request.post('foregin/order/pay/success/' + orderId);
}

// 查询医保余额
export function yibaoMoney(storeId) {
    return request.get(`foregin/order/getMedicalUserMoney?storeId=${storeId}`)
}

// // 医保支付成功后的回调
// export function callBackYibao(tradeNo) {
//     return request.get(`foregin/order/medicalReturn/${tradeNo}`)
// }

// 第三方跳转到本小程序查询医保支付信息
export function getPayInfoByTradeNo(tradeNo,ydbh) {
    return request.post(`foregin/drugPay/api/getPayInfoByTradeNo?tradeNo=${tradeNo}&ydbh=${ydbh}`,{}, {
		noAuth: true,
		noVerify: true
	})
}
// 判断是否是东营药店
export function getIsDongyingStore(orderId){
    return request.get(`foregin/order/isDongyingStore/${orderId}`)
}
// 获取可用优惠券的支付方式
export function getCouponPayType(storeId){
    return request.get(`wx/small/getCouponPayType/${storeId}`)
}


// // 农行接入后支付成功调用接口查询订单状态 
// export function getNewOrderStatus(orderId) {
//     return request.post(`foregin/order/paySuccessAbc?orderId=${orderId}`)
// }